﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BalanceControl.Comm
{
    public class CommManager
    {
        private static CommManager instance;
        private SerialHandler serialHandler;
        private TcpHandler tcpHandler;

        private CommManager()
        {
            serialHandler = new SerialHandler();
            tcpHandler = new TcpHandler();
        }
        public static CommManager GetInstance()
        {
            if (instance == null)
            {
                instance = new CommManager();
            }
            return instance;
        }

        /// <summary>
        /// 获取SerialHandler
        /// </summary>
        /// <returns></returns>
        public SerialHandler GetSerialHandler()
        {
            return serialHandler;
        }


        /// <summary>
        /// 获取TcpHandler
        /// </summary>
        /// <returns></returns>
        public TcpHandler GetTcpHandler()
        {
            return tcpHandler;
        }


    }
}
